/*
 * Thread.h
 *
 *  Created on: Sep 20, 2016
 *      Author: root
 */

#ifndef BASE_CONCURRENT_YTHREAD_H_
#define BASE_CONCURRENT_YTHREAD_H_
#include <pthread.h>
class Thread {
private:
	pthread_t thread;
	void (*fCallback)(Thread*);
	static void *createThread(void *arg);
	pthread_cond_t cond;
	pthread_mutex_t mutex;

public:
	Thread(void (*func)(Thread*));
	virtual ~Thread();
	void start();
	void sleep(long t);

};

#endif /* BASE_CONCURRENT_YTHREAD_H_ */
